package com.jm.programming.lambda;

import java.util.function.Function;
import java.util.function.IntPredicate;

/**
 * @Description
 * @date 2022/6/29 7:46
 */
public class Test4 {
    public static void main(String[] args) {
        Integer integer = typeCover(new Function<String, Integer>() {
            @Override
            public Integer apply(String s) {
                return Integer.valueOf(s);
            }
        });
        System.out.println(integer);

        Integer int2 = typeCover((String s) -> {
            return Integer.valueOf(s);
        });
        System.out.println(int2);
    }

    public static <R> R typeCover(Function<String , R> function){
        String str = "1235";
        return function.apply(str);
    }
}
